#ifndef AVALON_STOPWATCH_HPP
#define AVALON_STOPWATCH_HPP
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/noncopyable.hpp>
#include "Avalon/Threading/Threading.hpp"

namespace Avalon {
namespace Threading {

  /*! \class StopWatch
   *  \brief Implements a condition variable.
   */
  class StopWatch : private boost::noncopyable {
    public:

      //! Constructs a StopWatch.
      StopWatch();

      ~StopWatch();

      //! Starts the StopWatch.
      void Start();

      //! Stops the StopWatch.
      void Stop();

      //! Returns the time_duration elapsed between the last Start/Stop calls.
      boost::posix_time::time_duration GetElapsedTime() const;

    private:
      boost::posix_time::ptime m_startTime;
      boost::posix_time::ptime m_stopTime;
  };
}
}

#endif // AVALON_STOPWATCH_HPP
